import { IsEmail, IsNotEmpty, IsString, Length, Matches } from 'class-validator'

export class RegisterDto {
  @IsEmail({}, { message: '请提供有效的邮箱地址' })
  @IsNotEmpty({ message: '邮箱不能为空' })
  email: string

  @IsString({ message: '密码必须是字符串' })
  @Length(6, 20, { message: '密码长度必须在6-20之间' })
  password: string

  @Length(3, 20, { message: '昵称长度必须在3-20之间' })
  nickname: string

  @IsString()
  code: string;
}
